<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>循环中获取前10条数据</title>
    <script src="lodash.min.js"></script>
    <script src="../helpers/bing.js"></script>
  </head>
  <body>
    <script>
      const data = [
        { order: 1, value: "选项1", label: "黄金糕" },
        { order: 2, value: "选项2", label: "双皮奶" },
        { order: 3, value: "选项3", label: "蚵仔煎" },
        { order: 4, value: "选项4", label: "龙须面" },
        { order: 5, value: "选项5", label: "北京烤鸭" },
        { order: 6, value: "选项6", label: "小笼包" },
        { order: 7, value: "选项7", label: "麻辣烫" },
        { order: 8, value: "选项8", label: "红烧肉" },
        { order: 9, value: "选项9", label: "糖醋排骨" },
        { order: 10, value: "选项10", label: "酸菜鱼" },
        { order: 11, value: "选项11", label: "宫保鸡丁" },
        { order: 12, value: "选项12", label: "水煮牛肉" },
        { order: 13, value: "选项13", label: "东坡肉" },
        { order: 14, value: "选项14", label: "佛跳墙" },
        { order: 15, value: "选项15", label: "回锅肉" },
        { order: 16, value: "选项16", label: "担担面" },
        { order: 17, value: "选项17", label: "凉皮" },
        { order: 18, value: "选项18", label: "肉夹馍" },
        { order: 19, value: "选项19", label: "螺蛳粉" },
        { order: 20, value: "选项20", label: "煎饼果子" },
      ];
      
      data.forEach((item, index) => {
        if (index < 5) {

        } else {
          
          const windowList = data.slice((index - 4), index + 1);
          console.log(`第${index + 1} 的窗口数据：`);
          console.log(windowList);
        }
      });

    </script>
  </body>
</html>
